<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button id="btn">hhh</button>
    <script>
        //点击按钮，弹出对话框
        //事件源 事件类型 事件处理程序
        //1.事件源
        var btn = document.getElementById('btn');
        //2.事件类型
        //3.事件处理程序
        btn.onclick = function () {
            alert('666');
        }
        
    </script>
</body>

</html>